import request from '@/utils/request'

// 用户银行统计列表（分页）
export function pageList(query) {
  return request({
    url: '/system/bankCard/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 银行列表
export function list(query) {
  return request({
    url: '/system/bankCard/list',
    method: 'get',
    loading: true,
    params: query
  })
}

// 银行卡申请（分页）
export function applyPageList(query) {
  return request({
    url: '/system/bankCard/apply/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 卡bin详情信息
export function cardBinDetail(query) {
  return request({
    url: '/system/bankCard/bin',
    method: 'get',
    loading: true,
    params: query
  })
}

// 卡详情信息
export function bankDetail(id) {
  return request({
    url: '/system/bankCard/detail/' + id,
    method: 'get',
    loading: true
  })
}

// 银行卡列表（带消费和取现统计）（分页）
export function statListPageList(query) {
  return request({
    url: '/system/bankCard/statList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 消费交易列表（分页）
export function bankCardAuthTxPageList(query) {
  return request({
    url: '/system/bankCard/auth/txn/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 取现交易列表（分页）
export function bankCardAtmTxPageList(query) {
  return request({
    url: '/system/bankCard/atm/txn/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 卡种列表（分页）
export function cardTypePageList(query) {
  return request({
    url: '/system/bankCard/type/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 修改状态
export function changeShowStatus(id, showStatus) {
  const data = {
    id,
    showStatus
  }
  return request({
    url: '/system/bankCard/type/changeShowStatus',
    method: 'put',
    loading: true,
    data: data
  })
}

// 新增卡种
export function addCardType(data) {
  return request({
    url: '/system/bankCard/type',
    method: 'post',
    loading: true,
    data: data
  })
}

// 修改卡种
export function updateCardType(data) {
  return request({
    url: '/system/bankCard/type',
    method: 'put',
    loading: true,
    data: data
  })
}

// 查询卡种详细
export function getCardInfo(id) {
  return request({
    url: '/system/bankCard/type/' + id,
    method: 'get',
    loading: true
  })
}

// 删除卡种
export function delCardType(id) {
  return request({
    url: '/system/bankCard/type/' + id,
    method: 'delete',
    loading: true
  })
}

